<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/mobile-header.jsp"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html style="overflow-x:hidden;overflow-y:auto;">
<head>
<!-- Mobile Devices Support @begin -->

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta content="telephone=no, address=no" name="format-detection">
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" type="text/css" href="${ctxStatic }/modules/yuyue/css/common.css" media="all">
<link rel="stylesheet" type="text/css" href="${ctxStatic }/modules/yuyue/css/onlinebooking.css" media="all">

<script type="text/javascript">
	$(document).ready(function() {
	   $("#errorMessage").hide()
	});
	function checkForm(){
		 
		var name = $.trim($('#name').val());
		var mobileFlag = $("#mobileFlag").val();
		var mailFlag = $("#mailFlag").val();
		var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		
		if(name == null || name ==''){
			$("#errorMessage").html("请输入姓名");
			$("#errorMessage").show()
			return false;
		}else{
			$("#errorMessage").hide()
		}
		
		if(mobileFlag ==1){
			var mobile = $.trim($('#mobile').val());
			if(mobile == null || mobile ==''){
				$("#errorMessage").html("请输入手机");
				$("#errorMessage").show()
				return false;
			}else{
				if(/^1[3,4,5,8]\d{9}$/g.test(mobile)||(/^15[8,9]\d{8}$/g.test(mobile))){
					$("#errorMessage").hide();
					
				}else{
					$("#errorMessage").html("手机号输入错误");
					$("#errorMessage").show()
					return false;
				}
			}
		}
		
		if(mailFlag ==1){
			var email = $.trim($('#email').val());
			if(email == null || email ==''){
				$("#errorMessage").html("请输入邮箱");
				$("#errorMessage").show()
				return false;
			}else{
				if(!(myreg.test(email))){
					$("#errorMessage").html("请输入有效的邮箱");
					$("#errorMessage").show()
					return false;
				}
				else{
					$("#errorMessage").hide()
				}
			}
		}
		return true;
	}
</script>
</head>

<body>
<div class="body">
<div class="qiandaobanner"> 
		<img src="${ctxStatic }/modules/yuyue/images/38.jpg">
	</div>
<div class="cardexplain">
	<ul class="round1">
		<li>
			<span>${config.name}<!-- <em class="ok"></em> --></span>
		</li>
		<li>
			<span>${config.content}<!-- <em class="ok"></em> --></span>
		</li>
	</ul>
<style>
.message-tit{float:left;color: #333333;padding:0; font-size:16px; font-weight:normal;text-align: left;width: 79px;padding-top:10px;}
.message-input{float:left; width:80%}
</style>
	<ul class="round">
      <form:form id="inputForm" modelAttribute="onlineSignup" action="${ctxFront}/mobsite/signup/save?cid=${cid }&pid=${project.id}" method="post" onsubmit=" return checkForm();">
          
          <li class="title mb"><span class="none">请认真填写表单</span></li>
            
            <form:hidden path="id" />
			<input type="hidden" value="${config.mobileFlag }" id="mobileFlag" />
			<input type="hidden" value="${config.mailFlag }" id="mailFlag" />
			<input type="hidden" value="${config.user.id }" id="user.id" name="user.id"/>
			<input type="hidden" value="${memberId }" id="memberId" name="memberId"/>
			<input type="hidden" value="${wechatId }" id="wechatId"  name="wechatId"/>
			<input type="hidden" name="cid" value=${cid } />
			
                  <li class="nob">
                    <div class="message-tit">姓名</div>
                    <div class="message-input"><form:input path="name" htmlEscape="false"
								 class="px"  id="name"/></div>
                   </li>
                   
                  <c:if test="${config.mobileFlag eq 1 }">
                  <li class="nob">
                    <div class="message-tit">电话</div>
                    <div class="message-input"><form:input path="mobile"
									htmlEscape="false"  class="px" id="mobile"/>
                    </div>
                 </li>
                 </c:if>
                 
                 <c:if test="${config.qqFlag eq 1 }">
                 <li class="nob">
                   <div class="message-tit">QQ</div>
                    <div class="message-input"><form:input path="qq" htmlEscape="false"
									 class="px" /></div>
                 </li>
                 </c:if>
                 
                 <c:if test="${config.mailFlag eq 1 }">
                  <li class="nob">
                    <div class="message-tit">邮箱</div>
                    <div class="message-input"><form:input path="email" htmlEscape="false"
									 class="px" id="email"/></div>	
                 </li>
                 </c:if>
                 
                 <c:if test="${config.user.id eq 35 }">
                <li class="nob">
                  <div class="message-tit">申请方式</div>
                  <div class="message-input"><select name="remarks" class="px">
									<option value="1.申请免费试骑">1.申请免费试骑</option>
									<option value="2.直接申请租车">2.直接申请租车</option>
							</select></div>
                </li>
                </c:if>
                
                <c:if test="${!empty config.selfDefine}">
						<c:forEach items="${ config.onlineSignupConfigDetailsList }" var="detail" varStatus="i">
						
							<c:if test="${detail.type == 1}">
			                <li class="nob">
			                <div class="message-tit">${detail.name }:</div>
			                <div class="message-input">
			                <input type="text" name="${detail.id }" class="px">
			                </div>
			             	</li>
			             	</c:if>
			             	
			             	<c:if test="${detail.type == 2}">
								<li class="nob">
									<div class="message-tit">${detail.name }</div>
									<div class="message-input">
									 <form:radiobuttons name="${detail.id }" path="${types}" items="${detail.types}"/>  
									</div>
								</li>
							</c:if>
							
							<c:if test="${detail.type == 3}">
								<li class="nob">
									<div class="message-tit">${detail.name }</div>
									<div class="message-input">
									<form:checkboxes name="${detail.id }" path="${types}" items="${detail.types}"/>  
									</div>
								</li>
							</c:if>
							
							<c:if test="${detail.type == 4}">
								<li class="nob">
									<div class="message-tit">${detail.name }</div>
									<div class="message-input">
									<select name="${detail.id }" id="sex" class="px" >
											<c:forEach items="${detail.types}" var="types">
												<option value="${types}">${types}</option>
											</c:forEach>
									</select>
									</div>
								</li>
							</c:if>
							
							<c:if test="${detail.type == 5}">
								<li class="nob">
									<div class="message-tit">${detail.name }</div>
									<div class="message-input">
									<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
										<input id="createTime" name="${detail.id }" type="text" readonly="readonly"   class="px hasDatepicker"
											onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>  
									</div>
								</li>
							</c:if>
						</c:forEach>
					</c:if>
					<li class="nob"></li>
					<div align="center" class="alert" id="errorMessage" style="color: red;"></div>
    
       <div class="footReturn">
		<input id="showcard" class="submit" value="提交订单" type="submit"> 
	   </div>
	    </form:form>
	  
  </ul>
</div>

</div>

<footer style="text-align:center; color:#ffd800;margin-right:20px">
<a href="http://www.hdzhx.com/boxin/index.html" style="color: #000 !important">© 技术支持：智讯互联</a></footer>
</body>
</html>
